package com.objetdirect.gwt.umldrawer.shared.dto;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.OneToOne;
import javax.persistence.PrimaryKeyJoinColumn;
import javax.persistence.Table;

@Entity
@Table (name = "TASKS")
public class TasksDto implements Serializable {
	
	private static final long serialVersionUID = 1L;

	@Id
	@GeneratedValue
	@Column (name = "task_id", nullable = false, unique = true)
	private long taskId ;
	
	@Column (name = "task_name", nullable = false, length = 200)
	private String taskName ;
	
	@Column (name = "task_content", nullable = false, length = 10000)
	private String taskContent ;

	@OneToOne (fetch = FetchType.LAZY)
	@PrimaryKeyJoinColumn
	private ProjectDto projectId;
	
	public TasksDto() {
	}
	
	public TasksDto(long taskId) {
		this.taskId = taskId ;
	}
	
	public TasksDto(String taskName, String taskContent, ProjectDto projectId) {
		super();
		this.taskName = taskName;
		this.taskContent = taskContent;
		this.projectId = projectId;
	}

	public TasksDto(long taskId, String taskName, String taskContent) {
		super();
		this.taskId = taskId;
		this.taskName = taskName;
		this.taskContent = taskContent;
	}

	public long gettaskId() {
		return taskId;
	}

	public void settaskId(long taskId) {
		this.taskId = taskId;
	}

	public String getTaskName() {
		return taskName;
	}

	public void setTaskName(String taskName) {
		this.taskName = taskName;
	}

	public String getTaskContent() {
		return taskContent;
	}

	public void setTaskContent(String taskContent) {
		this.taskContent = taskContent;
	}

	public void setProjectId(ProjectDto projectId) {
		this.projectId = projectId;
	}

	public ProjectDto getProjectId() {
		return projectId;
	}
}
